package com.example.entity.system.vo;

import com.example.common.utils.StringUtils;
import lombok.Data;

import java.util.List;

/**
 * 路由显示信息
 *
 * @author ruoyi
 */

@Data
public class VueMetaVo {

    /**
     * 设置该路由在侧边栏和面包屑中展示的名字
     */
    private String title;

    /**
     * 内链地址（http(s)://开头）
     */
    private String isLink;

    /**
     * 是否隐藏路由，当设置 true 的时候该路由不会再侧边栏出现
     */
    private boolean isHide;

    /**
     * 设置为true，则不会被 <keep-alive>缓存 对应 ruoyi的noCache
     */
    private boolean isKeepAlive;

    /**
     * 是否隐藏路由，当设置 true 的时候该路由不会再侧边栏出现
     */
    private boolean isAffix;

    private boolean isIframe;

    private List<String> roles;

    /**
     * 设置该路由的图标，对应路径src/assets/icons/svg
     */
    private String icon;











    public VueMetaVo(String title, String icon) {
        this.title = title;
        this.icon = icon;
    }

    public VueMetaVo(String title, String icon, boolean noCache) {
        this.title = title;
        this.icon = icon;
        this.isKeepAlive = noCache;
    }

    public VueMetaVo(String title, String icon, String link) {
        this.title = title;
        this.icon = icon;
        this.isLink = link;
    }

    public VueMetaVo(String title, String icon, boolean noCache, String link, boolean isHide) {
        this.title = title;
        this.icon = icon;
        this.isHide = isHide;
        this.isKeepAlive = noCache;
        if (StringUtils.ishttp(link)) {
            this.isLink = link;
        }
    }

}

